/* 帖子详情页面样式 */

.back-nav {
    margin-bottom: 2rem;
}

.back-nav .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* 帖子详情 */
.post-detail {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.post-loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.post-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.post-meta span::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
    margin-right: 0.5rem;
}

.post-meta span:first-child::before {
    display: none;
}

.post-author {
    font-weight: 600;
    color: var(--primary-color);
}

.post-category {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.post-category::before {
    display: none;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.post-tag {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.post-tag:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

/* 帖子内容 */
.post-body {
    margin-bottom: 2rem;
}

.post-summary {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary-color);
}

.post-summary h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.post-summary p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.post-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.post-text h1,
.post-text h2,
.post-text h3,
.post-text h4,
.post-text h5,
.post-text h6 {
    margin: 2rem 0 1rem 0;
    color: var(--text-primary);
}

.post-text p {
    margin-bottom: 1.5rem;
}

.post-text img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.post-text blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

.post-text code {
    background: var(--bg-secondary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.post-text pre {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}

.post-text pre code {
    background: none;
    padding: 0;
}

/* 帖子操作 */
.post-footer {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.post-actions {
    display: flex;
    gap: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.action-btn:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
}

.action-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.like-btn.active .icon {
    animation: likeAnimation 0.3s ease;
}

@keyframes likeAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* 评论区 */
.comments-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.comments-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.comment-form {
    margin-bottom: 2rem;
}

.login-prompt {
    text-align: center;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    color: var(--text-secondary);
}

.login-prompt a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.login-prompt a:hover {
    text-decoration: underline;
}

.comment-input textarea {
    width: 100%;
    min-height: 100px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    margin-bottom: 1rem;
}

.comment-input textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.comment-actions {
    display: flex;
    justify-content: flex-end;
}

.comments-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.comment-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.comment-author {
    font-weight: 600;
    color: var(--primary-color);
}

.comment-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.comment-content {
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.comment-actions-bar {
    display: flex;
    gap: 1rem;
}

.comment-action {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.comment-action:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.comments-pagination {
    text-align: center;
    margin-top: 2rem;
}

/* 分享模态框 */
.share-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text-primary);
}

.share-option:hover {
    background: var(--bg-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.share-option .icon {
    font-size: 1.5rem;
}

.share-option .text {
    font-size: 0.9rem;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .post-detail {
        padding: 1.5rem;
        margin: 1rem;
        border-radius: 8px;
    }
    
    .post-title {
        font-size: 2rem;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .post-actions {
        flex-wrap: wrap;
    }
    
    .action-btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
    
    .comments-section {
        padding: 1.5rem;
        margin: 1rem;
        border-radius: 8px;
    }
    
    .share-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .post-title {
        font-size: 1.5rem;
    }
    
    .post-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
}